<?php
namespace app\user\validate\teacher;

use think\Validate;

/**
 * 用户验证
 */
class Teacher extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'    =>    ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'course_type'       => 'require|in:0,1,2,3,4',
        'mhm_id'            => 'require|integer',
        'category'          => 'require',
        'IDcard'            => 'require|idCard',
        'IDcard_positive'   => 'require|integer',
        'IDcard_side'       => 'require|integer',
        'certification'     => 'require|integer',
    ];

    protected $field = [
        'title'             => '账号',
        'user_id'           => '用户ID',
        'mhm_Id'            => '机构ID',
        'IDcard'            => '身份证号码',
        'IDcard_positive'   => '身份证正面附件',
        'IDcard_side'       => '身份证反面附件',
        'certification'     => '资格证书附件',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'    =>    '错误信息'
     *
     * @var array
     */
    protected $message = [
        'course_type.require' => '参数为空',
        'course_type.in'      => '参数错误',

    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'course'    => ['course_type'],
        'auth'      => ['category','IDcard','IDcard_positive','IDcard_side','certification'],
    ];


}
